home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / manual-p / man_db-2.000 / man_db-2 / man_db-2.3.10 / lib / waitpid.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-13  |  1.1 KB  |  33 lines

  1. /* waitpid -- emulate waitpid with wait3
  2.    Copyright (C) 1995 Carl Edman
  3.  
  4. This file is part of the libiberty library.
  5. Libiberty is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9.  
  10. Libiberty is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. Library General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Library General Public
  16. License along with libiberty; see the file COPYING.LIB.  If
  17. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  18. Cambridge, MA 02139, USA.  */
  19.  
  20. #ifdef HAVE_CONFIG_H
  21. #include "config.h"
  22. #endif
  23.  
  24. #include <sys/types.h>
  25. #include <sys/resource.h>
  26. #include <sys/wait.h>
  27.  
  28. int waitpid(int pid, int *statusp, int options)
  29.    {
  30.    if (pid==-1 || pid==0) return wait3((union wait *)statusp,options,0);
  31.    return wait4(pid>0 ? pid : -pid,(union wait *)statusp,options,0);
  32.    }
  33.